#ifndef _QUAT_
#define _QUAT_

struct Vec3;

struct Quat4
{
	Quat4() {}
	Quat4(float qx, float qy, float qz, float qw) { x = qx; y = qy; z = qz; w = qw; }

	float x, y, z, w;

	void	Decompose(Vec3& axis, float radian) const;

	static Quat4 MakeFromTo(const Vec3& va, const Vec3& vb);
	static Quat4 MakeFromAxisAngle(const Vec3& axis, float rad);
	static Quat4 Multiply(const Quat4& qa, const Quat4& qb);
	static Quat4 Slerp(const Quat4 &qa, const Quat4 &qb, float w);
	static float DotProduct(const Quat4 &qa, const Quat4 &qb) { return qa.x*qb.x + qa.y*qb.y + qa.z*qb.z + qa.w*qb.w; }

	static Quat4 MakeFromEuler(float rx, float ry, float rz);
	static void	MakeToEuler(const Quat4 &q, float *r);
} ;

#endif